import numpy as np

# 假设这是你的信号数据
signal = np.array([3.1, 5.3, 7.4, 9.2, 11.6, 5.5, 15.7, 17.8, 19.9, 21.0])

# 设置阈值
threshold = 0.5

# 计算移动平均
window_size = 3
moving_avg = np.convolve(signal, np.ones(window_size)/window_size, mode='same')

# 找出抖动的位置
jitter_indices = np.where(np.abs(signal - moving_avg) > threshold)[0]

print(f'抖动的位置: {jitter_indices}')
